package com.hc.fdkgoods.dao;

import com.hc.fdkgoods.vo.vo_5.CityCasecadeVO;
import com.hc.fdkgoods.vo.vo_5.MarketCascadeVO;
import com.hc.fdkgoods.vo.vo_5.ForwarderPageInitVO_5;
import com.hc.fdkgoods.vo.vo_5.MarketCascadeVO;
import org.jooq.Record1;
import org.jooq.Record6;
import org.jooq.Result;
import org.jooq.SelectJoinStep;

import java.util.ArrayList;
import java.util.List;

import static com.hc.fdkgoods.db.tables.ForwarderSupplier.FORWARDER_SUPPLIER;

public class ForwarderSupplierCasSearchDao extends BaseDao{
    public ForwarderPageInitVO_5 cityMarketFloorSearch() {
        ForwarderPageInitVO_5 res = new ForwarderPageInitVO_5();
//        SelectJoinStep<Record1<String>> query = db.selectDistinct(FORWARDER_SUPPLIER.CITY, FORWARDER_SUPPLIER.CITY_CODE)
//                .from(FORWARDER_SUPPLIER).fetchInto();
        Result<Record6<String, Long, String, Long, String, Long>> query = db.selectDistinct(FORWARDER_SUPPLIER.CITY, FORWARDER_SUPPLIER.CITY_CODE,
                FORWARDER_SUPPLIER.MARKET, FORWARDER_SUPPLIER.MARKET_CODE,
                FORWARDER_SUPPLIER.FLOOR, FORWARDER_SUPPLIER.FLOOR_CODE)
                .from(FORWARDER_SUPPLIER)
                .fetch();
        System.out.println(query.field("CITY"));

        return res;
    }
}
